import {  lazy } from "react";
import Home from '../pages/home/Index'
import {  Navigate } from "react-router-dom";


const Index=lazy(()=>import('../pages/index/Index'))
const User=lazy(()=>import('../pages/user/Index'))
const List=lazy(()=>import('../pages/list/Index'))
const Login=lazy(()=>import('../pages/login/Index'))
const Error=lazy(()=>import('../pages/index/Index'))


export const homee=[
    {
        path:'/home/index',
        element:<Index></Index>,
        title:'首页'
    },
    {
        path:'/home/user/id',
        element:<User></User>,
        title:'列表'
    },
    {
        path:'/home/list',
        element:<List></List>,
        title:'不知道'
    }
]




const router=[
    {
        path:'/',
        element:<Navigate to={'/home'}></Navigate>
    },
    {
        path:'/home',
        element:<Home></Home>,
        children:homee
    },
    {
        path:'/login',
        element:<Login></Login>
    },
    {
        path:'*',
        element:<Error></Error>
    }
]
export default router